﻿@using Lari.Configuration
@using Lari.Web.Utility
@model Lari.Services.ViewModel.UserMapModel
<div id="pagetitle">
    <h1>@ScreenName.Users.ChangeRole</h1>
</div>
<div class="spacer">
</div>
<div id="pagecontent">
    <div class="tab">
        Employee Details</div>
    <div class="tabContent">
        @Html.Partial("_EmployeeView", Model.EmployeeModel)
    </div>
    @if (Model.UserIsMapped)
    {
        <div style="width: 50%">
            @using (Html.BeginForm())
            {
                @Html.AntiForgeryToken("Changerole")
                <fieldset>
                    <legend>Role</legend>
                    
                    <div class="spacer">
                    </div>
                    
                    <div>
                        <label class="required">
                            Role</label>
                    </div>
                    <div>
                        @Html.DropDownListFor(m => m.RoleId, this.ToListItems(LookupEnum.Role),new{style="width:50%"})
                        @Html.HiddenFor(m => m.UserId)
                        @Html.HiddenFor(m => m.UserIsMapped)
                        @Html.HiddenFor(m => m.EmpId)
                    </div>
                    <div>
                        @Html.ValidationMessageFor(m => m.RoleId)
                    </div>
                    <div class="doubleSpacer"></div><div class="doubleSpacer">
                                              </div>

                    <div>
                        <input type="submit" value="Change Role" id="btnChangeRole" />
                    </div>
                </fieldset>
            }
        </div>
    }
    else
    {
        <div class="spacer">
        </div>  
        @Html.Partial("_DisplyMessaage", MessageCode.User.EmployeeIsNotMapedWithUser)
		 
    }
    <div class="spacer">
    </div>
    <div>@Html.ActionLink("Back to Employee Details", ActionConst.Users.ViewEmployee, new { id = Model.EmpId })</div>
    <div class="spacer">
    </div>
</div>
<script type="text/javascript">

    $(document).ready(function () {
        $("#btnChangeRole").button();
    });
</script>
